import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

var routes = [
  {
    path: '/',
    redirect: '/update',
  },
  {
    path: '/home',
    name: 'home',
    redirect: '/index',
    component: () => import(/* webpackChunkName: "mobile" */ '../views/Home.vue'),
    children: [
      {
        path: '/index',
        name: 'index',
        meta: { keepAlive: true }, //true缓存 false不缓存
        component: () => import(/* webpackChunkName: "mobile" */ '../views/mobile/index.vue')
      },
      {
        path: '/search',
        name: 'search',
        component: () => import(/* webpackChunkName: "main" */ '../views/main/search.vue')
      },
      {
        path: '/detail',
        name: 'detail',
        component: () => import(/* webpackChunkName: "product" */ '../views/product/detail.vue')
      },
      {
        path: '/zqProduct',
        name: 'zqProduct',
        component: () => import(/* webpackChunkName: "product" */ '../views/product/zqProduct.vue')
      },
      {
        path: '/shopCar',
        name: 'shopCar',
        component: () => import(/* webpackChunkName: "product" */ '../views/product/shopCar.vue')
      },
      {
        path: '/productComment',
        name: 'productComment',
        component: () => import(/* webpackChunkName: "product" */ '../views/product/productComment.vue')
      },
      {
        path: '/answerList',
        name: 'answerList',
        component: () => import(/* webpackChunkName: "product" */ '../views/product/answerList.vue')
      },
      {
        path: '/answerDetail',
        name: 'answerDetail',
        component: () => import(/* webpackChunkName: "product" */ '../views/product/answerDetail.vue')
      },
      {
        path: '/luntan',
        name: 'luntan',
        meta: { keepAlive: true },
        component: () => import(/* webpackChunkName: "mobile" */ '../views/mobile/luntan.vue')
      },
      {
        path: '/geren',
        name: 'geren',
        meta: { keepAlive: true },
        component: () => import(/* webpackChunkName: "mobile" */ '../views/mobile/geren.vue')
      },
      {
        path: '/rechargeIndex',
        name: 'rechargeIndex',

        component: () => import(/* webpackChunkName: "recharge" */ '../views/recharge/rechargeIndex.vue')
      },
      {
        path: '/rechargeHistory',
        name: 'rechargeHistory',
        component: () => import(/* webpackChunkName: "recharge" */ '../views/recharge/rechargeHistory.vue')
      },
      {
        path: '/activeIndex',
        name: 'activeIndex',
        component: () => import(/* webpackChunkName: "recharge" */ '../views/recharge/activeIndex.vue')
      },
      {
        path: '/shareActive',
        name: 'shareActive',
        component: () => import(/* webpackChunkName: "recharge" */ '../views/recharge/shareActive.vue')
      },
      {
        path: '/draw',
        name: 'draw',
        component: () => import(/* webpackChunkName: "recharge" */ '../views/recharge/draw.vue')
      },
      {
        path: '/history',
        name: 'history',
        component: () => import(/* webpackChunkName: "recharge" */ '../views/recharge/history.vue')
      },
      {
        path: '/luntanSearch',
        name: 'luntanSearch',
        component: () => import(/* webpackChunkName: "content" */ '../views/content/luntanSearch.vue')
      },

      {
        path: '/forumKonwledge',
        name: 'forumKonwledge',
        component: () => import(/* webpackChunkName: "content" */ '../views/content/forumKonwledge.vue')
      },
      {
        path: '/videoDetail',
        name: 'videoDetail',
        component: () => import(/* webpackChunkName: "content" */ '../views/content/videoDetail.vue')
      },
      {
        path: '/wodexinxi',
        name: 'wodexinxi',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/wodexinxi.vue')
      },
      {
        path: '/touxiang',
        name: 'touxiang',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/touxiang.vue')
      },
      {
        path: '/userInfo',
        name: 'userInfo',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/userInfo.vue')
      },
      {
        path: '/proHistory',
        name: 'history',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/history.vue')
      },
      {
        path: '/address',
        name: 'address',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/address.vue')
      },
      {
        path: '/collect',
        name: 'collect',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/collect.vue')
      },
      {
        path: '/invite',
        name: 'invite',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/invite.vue')
      },
      {
        path: '/orderList',
        name: 'orderList',
        component: () => import(/* webpackChunkName: "order" */ '../views/order/orderList.vue')
      },
      {
        path: '/searchOrder',
        name: 'searchOrder',
        component: () => import(/* webpackChunkName: "order" */ '../views/order/searchOrder.vue')
      },
      {
        path: '/orderDetail',
        name: 'orderDetail',
        component: () => import(/* webpackChunkName: "order" */ '../views/order/orderDetail.vue')
      },
      {
        path: '/wuliuInfo',
        name: 'wuliuInfo',
        component: () => import(/* webpackChunkName: "order" */ '../views/order/wuliuInfo.vue')
      },
      {
        path: '/evaluate',
        name: 'evaluate',
        component: () => import(/* webpackChunkName: "order" */ '../views/order/evaluate.vue')
      },
      {
        path: '/submitOrder',
        name: 'submitOrder',
        component: () => import(/* webpackChunkName: "order" */ '../views/product/submitOrder.vue')
      },
      {
        path: '/about',
        name: 'about',
        component: () => import(/* webpackChunkName: "about" */ '../views/about/about.vue')
      },
      // 功能介绍
      {
        path: '/gnjs',
        name: 'gnjs',
        component: () => import(/* webpackChunkName: "about" */ '../views/about/gnjs.vue')
      },
      // 隐私政策
      {
        path: '/yszc',
        name: 'yszc',
        component: () => import(/* webpackChunkName: "about" */ '../views/about/yszc.vue')
      },
      // 用户协议
      {
        path: '/yhxy',
        name: 'yhxy',
        component: () => import(/* webpackChunkName: "about" */ '../views/about/yhxy.vue')
      },
      // 特别声明
      {
        path: '/tbsm',
        name: 'tbsm',
        component: () => import(/* webpackChunkName: "about" */ '../views/about/tbsm.vue')
      },

    ]
  },
  {
    path: '/wxLogin',
    name: 'wxLogin',
    component: () => import(/* webpackChunkName: "mobile" */ '../views/mobile/wxLogin.vue')
  },
  // 更新页
  {
    path: '/update',
    name: 'update',
    component: () => import(/* webpackChunkName: "mobile" */ '../views/mobile/update.vue')
  },
  // 进入页
  {
    path: '/enterPage',
    name: 'enterPage',
    component: () => import(/* webpackChunkName: "mobile" */ '../views/mobile/enterPage.vue')
  },



]



const router = new VueRouter({
  routes,
})

router.beforeEach((to, from, next) => {

  return next()

})




export default router
